<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="TournamentEditDlg" widgetVar="TournamentEditDialog" modal="true" resizable="false"  appendTo="@(body)" header="#{myBundle.EditTournamentTitle}" closeOnEscape="true">

            <h:form id="TournamentEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{tournamentController.selected != null}">

                        <h:outputLabel value="#{myBundle.EditTournamentLabel_id}" for="id" />
                        <h:outputText id="id" value="#{tournamentController.selected.id}" />


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_game}" for="game" />
                        <p:inputText id="game" value="#{tournamentController.selected.game}" title="#{myBundle.EditTournamentTitle_game}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_game}" size="100" maxlength="100"/>


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_gametyp}" for="gametyp" />
                        <p:inputText id="gametyp" value="#{tournamentController.selected.gametyp}" title="#{myBundle.EditTournamentTitle_gametyp}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_gametyp}" size="100" maxlength="100"/>


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_team1}" for="team1" />
                        <p:inputText id="team1" value="#{tournamentController.selected.team1}" title="#{myBundle.EditTournamentTitle_team1}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_team1}" size="100" maxlength="100"/>


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_team2}" for="team2" />
                        <p:inputText id="team2" value="#{tournamentController.selected.team2}" title="#{myBundle.EditTournamentTitle_team2}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_team2}" size="100" maxlength="100"/>


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_scoreteam1}" for="scoreteam1" />
                        <p:inputText id="scoreteam1" value="#{tournamentController.selected.scoreteam1}" title="#{myBundle.EditTournamentTitle_scoreteam1}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_scoreteam1}"/>


                        <p:outputLabel value="#{myBundle.EditTournamentLabel_scoreteam2}" for="scoreteam2" />
                        <p:inputText id="scoreteam2" value="#{tournamentController.selected.scoreteam2}" title="#{myBundle.EditTournamentTitle_scoreteam2}" required="true" requiredMessage="#{myBundle.EditTournamentRequiredMessage_scoreteam2}"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{tournamentController.save}" value="#{myBundle.Save}" update="display,:TournamentListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,TournamentEditDialog);">
                        <p:confirm header="#{myBundle.ConfirmationHeader}" message="#{myBundle.ConfirmEditMessage}" icon="ui-icon-alert"/>
                    </p:commandButton>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="TournamentEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
